import axios from "axios";
const http = axios.create({
    timeout: 3000
  })
  
  //请求拦截
  http.interceptors.request.use(
    (config) => {
      //每次请求的时候,携带token ,
      // config.headers['token'] = localStorage.getItem('token')
      return config
    },
    (err) => Promise.reject(err)
  )
  
  //响应拦截
  http.interceptors.response.use(
    (response) => {
      return response
    },
    (err) => Promise.reject(err)
  )
  
  export default http